package com.dp.vo;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "t_subject_resources")
//@NamedQueries({@NamedQuery(name = "TSubjectResources.findAll", query = "SELECT t FROM TSubjectResources t"), @NamedQuery(name = "TSubjectResources.findByResourceid", query = "SELECT t FROM TSubjectResources t WHERE t.resourceid = :resourceid")})
public class TSubjectResources  implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@Column(name = "resourceid")                 
	private String resourceid;                   //主题资源id
	@Column(name = "contentid")     
	private String contentid;                    //所属内容id
	@Column(name = "useragents")
	private String useragents;                   //ua list
	@Column(name = "name")
	private String name;                         //资源名称
	@Column(name = "type")
	private String type;                         //1 图片 2 音频 3游戏 4电子书 5电子书客户端 6电子书支持 7铃音盒 8主题 9视频 10软件,11 推广图,12预览图
	@Column(name = "url")
	private String url;                          //文件存储位置
	@Column(name = "size")              
	private int size;                            //文件大小
	@Column(name = "format")
	private String format;                       //格式
	@Column(name = "distributorid")
	private String distributorid;                //渠道id
	@Column(name = "newformat")
	private String newformat;
	@Column(name = "fullpath")
	private String fullpath;
	@JoinColumn(name = "contentid", referencedColumnName = "contentid", insertable = false, updatable = false)   
	@ManyToOne
    private TSubject tsubject;
	
	public TSubjectResources(){
	}
	public TSubjectResources(String resourceid){
		this.resourceid=resourceid;
	}
	
	public String getResourceid() {
		return resourceid;
	}
	public void setResourceid(String resourceid) {
		this.resourceid = resourceid;
	}
	public String getContentid() {
		return contentid;
	}
	public void setContentid(String contentid) {
		this.contentid = contentid;
	}
	public String getUseragents() {
		return useragents;
	}
	public void setUseragents(String useragents) {
		this.useragents = useragents;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public String getFormat() {
		return format;
	}
	public void setFormat(String format) {
		this.format = format;
	}
	public String getDistributorid() {
		return distributorid;
	}
	public void setDistributorid(String distributorid) {
		this.distributorid = distributorid;
	}
	public String getNewformat() {
		return newformat;
	}
	public void setNewformat(String newformat) {
		this.newformat = newformat;
	}
	public String getFullpath() {
		return fullpath;
	}
	public void setFullpath(String fullpath) {
		this.fullpath = fullpath;
	}
	public TSubject getTsubject() {
		return tsubject;
	}
	public void setTsubject(TSubject tsubject) {
		this.tsubject = tsubject;
	}
	
	@Override
	public int hashCode() {
	        int hash = 0;
	        hash += (resourceid != null ? resourceid.hashCode() : 0);
	        return hash;
	}

    @Override
	public boolean equals(Object object) {
	    if (!(object instanceof TSubjectResources)) {
	          return false;
	     }
	    TSubjectResources other = (TSubjectResources) object;
	     if ((this.resourceid == null && other.resourceid != null) || (this.resourceid != null && !this.resourceid.equals(other.resourceid))) {
	         return false;
	     }
	     return true;
	}
	    
	@Override
    public String toString() {
        return "com.dp.vo.TSubjectResources[resourceid=" + resourceid + "]";
    }
	
}
